import VueRouter from "vue-router";
const routes = [
    {
        path:'/',
        name:'login',
        component:()=>import('../components/LoginPage.vue')
    },
    {
        path:'/IndexPage',
        name:'index',
        component:()=>import('../components/IndexPage.vue'),
        children:[
            {
                path:'/HomePage',
                name:'home',
                meta:{
                    title:'首页'
                    },
                component:()=>import('../components/HomePage.vue')

            },
            {
                path:'/UserPage',
                name:'user',
                meta:{
                    title:'用户'
                },
                component:()=>import('../components/UserPage.vue')

            },
            {
                path:'/ActivityPage',
                name:'active',
                meta:{
                    title:'活动管理'
                },
                component:()=>import('../components/ActivityPage.vue')

            },
            {
                path:'/ClassPage',
                name:'class',
                meta:{
                    title:'教学班管理'
                },
                component:()=>import('../components/ClassPage.vue')

            },
            {
                path:'/StudentPage',
                name:'student',
                meta:{
                    title:'学员管理'
                },
                component:()=>import('../components/StudentPage.vue')

            },
            {
                path:'/TeacherPage',
                name:'teacher',
                meta:{
                    title:'教师管理'
                },
                component:()=>import('../components/TeacherPage.vue')

            },
            {
                path:'/CoursePage',
                name:'course',
                meta:{
                    title:'课程管理'
                },
                component:()=>import('../components/CoursePage.vue')

            },
        ]
    },
]

const router = new VueRouter({
    mode:'history',
    routes
})
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(to){
    return VueRouterPush.call(this,to).catch(err=>err)
}

export default router;